//
//  HeadCollectionViewCell.m
//  TourPlay
//
//  Created by dllo on 15/11/26.
//  Copyright © 2015年 王军岐. All rights reserved.
//

#import "HeadCollectionViewCell.h"

@interface HeadCollectionViewCell ()

@property (nonatomic, retain) UIImageView *imageV;
@property (nonatomic, retain) UILabel *headL;

@end



@implementation HeadCollectionViewCell
- (void)dealloc
{
    [_imageV release];
    [_headL release];
    [super dealloc];
}
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self createSubViews];
    }
    return self;
}
- (void)createSubViews
{
    
    
    
    self.imageV = [[UIImageView alloc] initWithFrame:CGRectMake((SCREEN_WIDTH / 4.f - (SCREEN_WIDTH / 4.f - 40 * AUTOSCREEN_WIDTH)) / 2.f, 15 * AUTOSCREEN_HEIGHT, SCREEN_WIDTH / 4.f - 40 *AUTOSCREEN_WIDTH, SCREEN_WIDTH / 4.f - 40 * AUTOSCREEN_WIDTH)];
    
    // 裁掉边框
    self.imageV.layer.masksToBounds = YES;
    self.imageV.layer.cornerRadius = self.imageV.frame.size.width / 2.f;
    [self.contentView addSubview:self.imageV];
    [_imageV release];
    
    self.headL = [[UILabel alloc] initWithFrame:CGRectMake(self.imageV.frame.origin.x, self.imageV.frame.origin.y + self.imageV.frame.size.height, self.imageV.frame.size.width, 110.f * AUTOSCREEN_HEIGHT - self.imageV.frame.origin.y - self.imageV.frame.size.height)];
//    self.headL.backgroundColor = [UIColor whiteColor];
    self.headL.textAlignment = NSTextAlignmentCenter;
    self.headL.textColor = [UIColor colorWithRed:0.4 green:0.36 blue:0.36 alpha:1];
    self.headL.font = [UIFont systemFontOfSize:15.f];
    
    [self.contentView addSubview:self.headL];
    [_headL release];
}
- (void)setNSIndexPath:(NSIndexPath *)indexPath
{
    if (0 == indexPath.row) {
        self.imageV.image = [UIImage imageNamed:@"mark@2x.png"];
        self.headL.text = @"排行榜";
    } else if (1 == indexPath.row) {
        self.imageV.image = [UIImage imageNamed:@"nearby@2x.png"];
        self.headL.text = @"排行榜";
    } else if (2 == indexPath.row) {
        self.imageV.image = [UIImage imageNamed:@"num@2x.png"];
        self.headL.text = @"排行榜";
    } else if (3 == indexPath.row) {
        self.imageV.image = [UIImage imageNamed:@"num@2x.png"];
        self.headL.text = @"排行榜";
    }
}
@end
